import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { HomeService } from '../home/home.service';
import { KnowledgeCenterComponent } from './knowledge-center.component';
import { ModalModule } from '../../shared/components/modal/modal.module';
import { NewsDetailComponent } from './news-detail/news-detail.component';
import { ReadMoreModule } from '../../shared/components/read-more/read-more.module';
import { NewsListComponent } from './news-list/news-list.component';
import { EventsListComponent } from './events-list/events-list.component';
import { SpotlightsListComponent } from './spotlights-list/spotlights-list.component';

const routes: Routes = [
    {
        path: ':type',
        component: KnowledgeCenterComponent
    },
    {
        path: ':type/:id',
        component: KnowledgeCenterComponent
    }
];

@NgModule({
    providers: [
        HomeService
    ],
    imports: [
        CommonModule,
        ModalModule,
        ReadMoreModule,
        RouterModule.forChild(routes)
    ],
    declarations: [
        KnowledgeCenterComponent,
        NewsListComponent,
        NewsDetailComponent,
        EventsListComponent,
        SpotlightsListComponent
    ],
    exports: [
        KnowledgeCenterComponent,
        NewsDetailComponent
    ]
})
export class KnowledgeCenterModule { }
